import { checkPhone, handlerGobackClick, hint } from "../../../utils/util";
import User from "../../../models/user";

const user = new User();
Page({
  /**
   * 页面的初始数据
   */
  data: {
    phone: "",
  },
  onLoad() {},
  handlerGobackClick,
  onReady() {},
  goBefore() {
    // wx.redirectTo({
    //   url:'/pages/login-before/index'
    // })
    wx.reLaunch({
      url: "/pages/home/index",
    });
  },
  nextGetCode() {
    let result = checkPhone(this.data.phone);
    if (result !== true) {
      hint(result);
      return;
    }
    wx.navigateTo({
      url: "/owner-app/pages/input-auth-code/index?phone=" + this.data.phone,
    });
  },
  bindInput(e) {
    console.log(e);
    this.setData({
      phone: e.detail.value,
    });
  },
});
